import {NgModule} from '@angular/core';
import {
  GnFormModule,
  GnJsonFormModule,
  GnJsonTableModule,
  GnModalButtonModule,
  GnRouteGuard,
  GnTableModule,
  GnTreeModule
} from 'geminis-ng';
import {CommonModule} from '@angular/common';
import {NzButtonModule} from 'ng-zorro-antd/button';
import {NzIconModule} from 'ng-zorro-antd/icon';
import {RouterModule, Routes} from '@angular/router';
import {FormEditorComponent} from './form-editor/form-editor.component';
import {FormItemsComponent} from './form-editor/form-items/form-items.component';
import {FormListComponent} from './form-list.component';
import {NzTabsModule} from 'ng-zorro-antd/tabs';
import {NzLayoutModule} from 'ng-zorro-antd/layout';
import {NzListModule} from 'ng-zorro-antd/list';
import {NzCardModule} from 'ng-zorro-antd/card';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {NzFormModule} from 'ng-zorro-antd/form';
import {NzCollapseModule} from 'ng-zorro-antd/collapse';
import {NzToolTipModule} from 'ng-zorro-antd/tooltip';
import {NzInputModule} from 'ng-zorro-antd/input';
import {FormsModule} from '@angular/forms';
import {FormPreviewComponent} from './form-editor/form-preview/form-preview.component';
import {FormEditorItemTableButtonComponent} from './form-editor/form-items/item-table-button.component';
import {CategoryTreeModule} from "../category-tree/category-tree.module";
import {FormListButtonComponent} from "./form-list-button.component";
import {NzUploadModule} from 'ng-zorro-antd/upload';

const routes: Routes = [
  {
    path: '',
    component: FormListComponent,
    canActivate: [GnRouteGuard]
  }
];

@NgModule({
  declarations: [
    FormListComponent,
    FormListButtonComponent,
    FormEditorComponent,
    FormItemsComponent,
    FormPreviewComponent,
    FormEditorItemTableButtonComponent
  ],
  imports: [
    RouterModule.forChild(routes),
    CommonModule,
    DragDropModule,

    NzButtonModule,
    NzIconModule,
    NzTabsModule,
    NzLayoutModule,
    NzListModule,
    NzCardModule,
    NzFormModule,
    NzCollapseModule,
    NzToolTipModule,
    NzInputModule,
    NzUploadModule,

    GnTreeModule,
    GnTableModule,
    GnJsonTableModule,
    GnJsonFormModule,
    GnModalButtonModule,
    GnFormModule,

    CategoryTreeModule,
    FormsModule
  ],
  bootstrap: [
    FormListButtonComponent,
    FormEditorComponent,
    FormItemsComponent,
    FormPreviewComponent,
    FormEditorItemTableButtonComponent]
})

export class FormModule {
}
